package com.my.hzb.user.ctrl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.my.hzb.common.bean.ResultBean;
import com.my.hzb.entiy.Role;
import com.my.hzb.user.service.RoleService;
import com.my.hzb.user.service.UserRoleService;

@Controller
@RequestMapping("role")
public class RoleCtrl {

	@Autowired
	private RoleService roleService;
	@Autowired
	private UserRoleService userRoleService;
	
	@RequestMapping("addRole")
	public void addRole(Role role){
		roleService.add(role);
	}
	
	@RequestMapping("getRoleList")
	public ResultBean getRoleList(Role role){
		ResultBean result = new ResultBean(ResultBean.RETURN_ERROR_CODE,ResultBean.RETURN_ERROR_MSG);
		List<Role> list = roleService.find(role);
//		result.setReturnList((List<Object>)list);
		return result;
	}
}
